package uk.co.revisual.puremvc.loader.factories
{

	
	import mx.modules.IModuleInfo;
	

	import uk.co.revisual.puremvc.loader.interfaces.ICreate;
	
	public class ModuleFactory implements ICreate
	{
		private var mAsset:IModuleInfo
		
		public function ModuleFactory(asset:IModuleInfo)
		{
			mAsset = asset;
		}
		
		public function create(id:String = ""):*
		{
			
			switch(true)
			{
				case(id == "asset"):
					return mAsset;

				default:
					return mAsset.factory.create();
					
			}
			
		}

	}
}